import { createStore, applyMiddleware } from 'redux'
import reducer from './reducer'
import logger from 'redux-logger'
import { persistStore, persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage'
import thunk from 'redux-thunk'
let persistedReducer = persistReducer({ key: 'redux', storage }, reducer)

var store = createStore(persistedReducer, applyMiddleware(logger, thunk))
export var persistor = persistStore(store);

export default store;
